// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'
import themePluginConfig from '../config/themePluginConfig'

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
import { VueAxios } from './utils/request'
import i18n from './locales'
import { Rate } from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import ProLayout, { PageHeaderWrapper } from '@ant-design-vue/pro-layout'

// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
import bootstrap from './core/bootstrap'
import './core/lazy_use'
import './permission' // permission control
import './utils/filter' // global filter
import './components/global.less'
import '@/assets/theme/css/fx.css'
import '@/assets/theme/css/system.css'
import { WxRole } from '@/utils/wxRoles'
import { WxTime } from '@/utils/timeDirective'

import AmapVue from '@amap/amap-vue'

AmapVue.config.version = '2.0' // 默认2.0，这里可以不修改
AmapVue.config.key = '2d2300bdc53c61e358f4c82f3e2faf6b'
AmapVue.config.plugins = [
  'AMap.ToolBar',
  'AMap.MoveAnimation',
  // 在此配置你需要预加载的插件，如果不配置，在使用到的时候会自动异步加载
]

Vue.use(Rate)
Vue.use(AmapVue)

Vue.config.productionTip = false
// mount axios Vue.$http and this.$http
Vue.use(VueAxios)
Vue.use(WxRole)
Vue.use(WxTime)
Vue.component('pro-layout', ProLayout)
Vue.component('page-header-wrapper', PageHeaderWrapper)

window.umi_plugin_ant_themeVar = themePluginConfig.theme
new Vue({
  router,
  store,
  i18n,
  created: bootstrap,
  render: (h) => h(App),
}).$mount('#app')
